package com.TinyBBS.db;

import java.util.List;

import com.TinyBBS.bean.Game;
import com.TinyBBS.model.GameModel;

public class test {
	

	public static void main(String args[]) throws Exception {

		/*Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
		final String[] sendTo = { "heli_070419@hotmail.com" };
		final String emailMsgTxt = "Test Message Contents";
		final String emailSubjectTxt = "A test from gmail";
		
		Util.sendSSLMessage(sendTo, emailSubjectTxt, emailMsgTxt, Config.EMAIL_FROM);
		System.out.println("Sucessfully Sent mail to All Users");*/
		DBCRUD crud = new DBCRUD();
		final String table =  "review";
		final String where = "id = '1'";
		if(crud.delete(table, where)){
			System.out.println("delete successfully.");
		}else{
			System.out.println("delete failed");
		}
		
		/*Map<String,Object> map = new HashMap<String,Object>();
		String pass = "heliwang";
		map.put("password", Util.getHashWithSalt(pass, Config.SALT));
		crud.update("user", map, "email='heli@hotmail.com'");*/
		/*Random random = new Random();
		System.out.println(Util.GenerateInteger(100000, 999999, random));
		System.out.println(Util.getHashWithSalt("147677", Config.SALT));*/
		/*GameModel gameM = new GameModel();
		//List gameList = gameM.getEntryList(0, 6);
		Game game = new Game();
		game = gameM.getGameById("1");
		
		game = (Game) gameList.get(0);
		System.out.println(game.getRating());*/
		
	}

	
}
/**
 * @param args
 * @throws UnsupportedEncodingException
 * @throws ParseException
 */
// public static void main(String[] args) {
// TODO Auto-generated method stub
/*
 * UserModel userM = new UserModel(); User user = new User(); if((user =
 * userM.verifyUser("heli@hotmail.com", "heli"))==null || user.getAccess_level()
 * == Util.PENDING){ System.out.println("user not exist!"); }else{
 * System.out.println("user exists"+ user.getUsername()); }
 */
// System.out.println(Util.getHashWithSalt("heli", Config.SALT));
/*
 * try { Util.sendEmail("heli_070419@hotmail.com", "test", "test"); } catch
 * (UnsupportedEncodingException e) { // TODO Auto-generated catch block
 * System.out.println("failed"); e.printStackTrace(); }
 */
/*
 * byte[] buf = "heli".getBytes();
 * 
 * 
 * BigInteger bi = new BigInteger(1,buf); System.out.println(bi.toString(16));
 */
// (new BigInteger(1, alg.digest())
/*
 * User user = new User(); user.setUsername("heli"); user.setFirstname("heli");
 * user.setLastname("wang"); user.setEmail("heli@hotmail.com");
 * user.setPassword("heli"); user.setToken("128932");
 * user.setStartdate(Util.getCurrentTimeStamp()); user.setAccess_level(1);
 * if(userM.insertUser(user)){ System.out.println("inserted"); }else{
 * System.out.println("failed to insert"); }
 */
// System.out.println(user.getAllUser().get(0).getEmail());*/
/*
 * DBCRUD crud = new DBCRUD(); ResultSet rs = null;
 * 
 * 
 * Map<String,Object> mp=new HashMap<String, Object>(); mp.put("username",
 * "heli070419"); mp.put("firstname", "heli"); mp.put("lastname", "wang");
 * mp.put("password", "heli"); mp.put("email", "heli@hotmail.com");
 * mp.put("token", "198412"); mp.put("startdate", Util.getCurrentTimeStamp());
 * mp.put("access_level", 1); List pl = new ArrayList(); pl.add("username");
 * pl.add("email"); String where = "username = 'heli'"; rs = crud.fetch("user",
 * pl, where); try{ while(rs.next()){
 * System.out.println(rs.getString("username"));
 * System.out.println(rs.getString("email")); } }catch(Exception e){
 * e.printStackTrace();
 * 
 * } //System.out.println(list.get(0)); if(crud.insert("user", mp)){
 * System.out.println("Record Inserted"); }else{
 * System.out.println("Failed to insert"); } //rs = crud.fetchAll("user"); try{
 * while(rs.next()){ System.out.println(rs.getString("login"));
 * System.out.println(rs.getString("password")); } }catch(Exception e){
 * e.printStackTrace(); }
 */

